#include <bits/stdc++.h>
using namespace std;
int hi[100000];
int wi[100000];
int main()
{
#ifdef LOCAL
    freopen("PREV-37.in", "r", stdin);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int N, K;
    cin >> N >> K;
    int mLen = INT_MIN;
    for(int i = 0; i < N; ++i)
        cin >> hi[i] >> wi[i], mLen = max(mLen, max(hi[i], wi[i]));
    //枚举k块巧克力的边的长度, 看N块儿当中能否分分出来K个
    while(mLen >= 1)
    {
        int cnt = 0;
        for(int i = 0; i < N; ++i)
        {
            cnt += (wi[i] / mLen) * (hi[i] / mLen);  
        }
        if(cnt >= K) break;
        mLen--;
    }
    cout << mLen << endl;
    return 0;
}